﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data.OleDb;
using System.Data;

namespace EasyChat_Server.DAL
{
    public class TestDAL
    {
       
        public string RunProc(string procName, string str, string udl)
        {
            try
            {
                OleDbParameter[] para = new OleDbParameter[] 
                   { 
                       new OleDbParameter("@UserId",str),
                       new OleDbParameter("AS_OUT", OleDbType.VarChar, 1024 ), //输出参数
                       new OleDbParameter("AI_DO", OleDbType.Integer ), //输出参数
                   };
                para[0].Direction = ParameterDirection.Input;
                para[1].Direction = ParameterDirection.Output;
                para[2].Direction = ParameterDirection.Output;
                DBHelper dbsql = new DBHelper();
                dbsql.RunProc(procName, para, udl);
                return para[1].Value.ToString();
            }
            catch (Exception)
            {
                throw;
            }
        }
    }
}
